﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace zijian666.CommandLineExtensions;

//[Description("打个招呼吧")]
[CommandLineAction("hello", Alias = ["hi"], Description = "打个招呼吧")]
internal class Hello //: ICommandLineAction
{
    [Option(Alias = ["n"])]
    [Description("你的名字")]
    //[Required]
    public required string Name { get; set; }


    [Option(Alias = ["j"])]
    [Description("你的职业")]
    public string[]? Job { get; set; }

    public void Execute()
    {
        if (Job?.Length is 0 or null)
        {
            Console.WriteLine($"你好, {Name}!");
        }
        else
        {
            Console.WriteLine($"你好, {string.Join("/", Job)} {Name}!");
        }
    }
}
